home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 January / maximum-cd-2002-01.iso / Files / Mechwarrior 4 Mapping / Materials / Custom Scripts / mst-tko2h.ABL < prev    next >
Encoding:
Text File  |  2001-08-21  |  4.9 KB  |  216 lines

  1. // Mechstorms King of Team 2 Hills by giskard.
  2. // Thanks to Paladlin for all the help in creating this first mechstorm script.
  3. // This is a team 2 script, mostly team only points but points for damage can be earned by the player.
  4. // Install into mechwarror4/content/missions/yourmission/scripts and select from mission properties
  5. // in the mission editor.
  6. // Your map will need to have the following navpoints & dropzones present for this script to work
  7. // Team_1_hill
  8. // Team_2_hill
  9. // Team1_Dropzone
  10. // Team2_Dropzone
  11. // Nav_center
  12.  
  13. fsm stormytko2h : integer;
  14.  
  15.     const
  16.         #include_ <content\ABLScripts\mwconst.abi>
  17.  
  18.     type
  19.         #include_ <content\ABLScripts\mwtype.abi>
  20.  
  21. // Vars
  22.  
  23.     var
  24.         static integer        Team1;
  25.         static integer        Team2;
  26.         static integer        Team1_Timer;
  27.         static integer        Team2_Timer;
  28.         static integer        general_Timer;
  29.  
  30.         static integer        Team1_Score_Holder;
  31.         static integer        Team2_Score_Holder;
  32.         static integer        Max_Score_Holder;
  33.         static integer        Radius;
  34.  
  35.         static ObjectID     Nav_center;
  36.         static ObjectID     Team1Hill;
  37.         static ObjectID     Team2Hill;
  38.  
  39.         static ObjectID     Team1_Dropzone;
  40.         static ObjectID     Team2_Dropzone;
  41.  
  42.         static boolean        Team1_In;
  43.         static boolean        Team2_In;
  44.  
  45. // Functions
  46.  
  47. function init;
  48.     code
  49.         // Changeable Vars
  50.         SetCustomBucketName("Team King of 2 Hills");
  51.         radius = 200;       // just change this to change the detection radius of all zones.
  52.         AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-500);
  53.         AddCustomBucketParameter(Bucket_SUICIDES,-500);
  54.         AddCustomBucketParameter(Bucket_ENEMY_DAMAGE_INFLICT, 1);
  55.         AddCustomBucketParameter(Bucket_ENEMY_KILLS, 50);
  56.         AddCustomBucketParameter(Bucket_FRIENDLY_DAMAGE_INFLICT,-1);
  57.  
  58.         // Leave these Alone
  59.         Settimer(gti_timer_1,0);
  60.         Settimer(gti_timer_2,0);
  61.         Team1 = TeamObjectID(1);
  62.         Team2 = TeamObjectID(2);
  63.         Max_Score_Holder = 50;
  64.  
  65.         Team1_Timer = gti_timer_1;
  66.         Team2_Timer = gti_timer_2;
  67.  
  68.         Team1_In = false;
  69.         Team2_In = false;
  70.  
  71.         Team1hill = ena_Team_1_Hill;
  72.         Team2hill = ena_Team_2_Hill;
  73.         Team1_Dropzone = ena_Team1_Dropzone;
  74.         Team2_Dropzone = ena_Team2_Dropzone;
  75.         Nav_Center = ena_Nav_center;
  76.  
  77.         SetFlagsEnabled(FLAGS_HIDE);
  78.         TrackBucket(Bucket_CUSTOM,0,true);
  79.         AddStandardBuckets;
  80.  
  81.          endfunction;
  82.  
  83. // Startstate 
  84.  
  85. state startState;
  86.     code
  87.         // Show These Navpoints
  88.         RevealNavPoint(ena_Team_1_Hill);
  89.         RevealNavPoint(ena_Team_2_Hill);
  90.         RevealNavPoint(ena_Team1_Dropzone);
  91.         RevealNavPoint(ena_Team2_Dropzone);
  92.         RevealNavPoint(ena_Nav_Center);
  93.  
  94.         // Set player navpoints at start of game to.....
  95.         TeamSetNav(1,ena_Team_2_Hill);
  96.         TeamSetNav(2,ena_Team_1_Hill);
  97.  
  98.         Trans scoring;
  99.  
  100. endstate;
  101.  
  102.  
  103. // timer
  104.  
  105. state scoring;
  106.     code
  107.  
  108. // Team 1 scoring
  109.                    if ((Team1_In) == false) then
  110.                     if (IsWithin(TeamObjectID(1),Team2Hill,radius) == true) then
  111.                         Team1_In = true;
  112.                         resettimer(Team1_Timer);
  113.                         Team1_Score_Holder = 1;
  114.                     endif;
  115.                 endif;
  116.  
  117.                 if ((Team1_In) == true) then
  118.                     if (timegreater(Team1_Timer,Team1_Score_Holder)) then
  119.                         if (IsWithin(TeamObjectID(1),Team2Hill,radius) == true) then
  120.  
  121.                             Team1_Score_Holder = Team1_Score_Holder + 1;
  122.  
  123.                             if ((Team1_Score_Holder) < 10) then
  124.                             addpoints(Team1, 10);
  125.                             Trans scoring;
  126.                             endif;
  127.  
  128.  
  129.  
  130.                             if ((Team1_Score_Holder) < 20) then
  131.                             addpoints(Team1, 20);
  132.                             Trans scoring;
  133.                             endif;
  134.  
  135.  
  136.                             if ((Team1_Score_Holder) < 30) then
  137.                             addpoints(Team1, 30);
  138.                             Trans scoring;
  139.                             endif;
  140.  
  141.  
  142.                             if ((Team1_Score_Holder) < 40) then
  143.                             addpoints(Team1, 40);
  144.                             Trans scoring;
  145.                             endif;
  146.  
  147.                             if ((Team1_Score_Holder) <> 50) then
  148.                             addpoints(Team1, 50);
  149.                             Trans scoring;
  150.                             endif;
  151.  
  152.                         else
  153.                             Team1_in = false;
  154.  
  155.                         endif;
  156.                     endif;
  157.                 endif;
  158.  
  159.  
  160. // Team 2 scoring
  161.  
  162.                 if ((Team2_In) == false) then
  163.                     if (IsWithin(TeamObjectID(2), Team1Hill, radius)) == true then
  164.                         Team2_In = true;
  165.                         resettimer(Team2_Timer);
  166.                         Team2_Score_Holder = 1;
  167.                     endif;
  168.                 endif;
  169.  
  170.                 if ((Team2_In) == true) then
  171.                     if (timegreater(Team2_Timer,Team2_Score_Holder)) then
  172.                         if (IsWithin(TeamObjectID(2),Team1Hill,radius) == true) then
  173.  
  174.                             Team2_Score_Holder = Team2_Score_Holder +1;
  175.  
  176.                             if ((Team2_Score_Holder) < 10) then
  177.                             addpoints(Team2, 10);
  178.                             Trans scoring;
  179.                             endif;
  180.  
  181.                             if ((Team2_Score_Holder) < 20) then
  182.                             addpoints(Team2, 20);
  183.                             Trans scoring;
  184.                             endif;
  185.  
  186.                             if ((Team2_Score_Holder) < 30) then
  187.                             addpoints(Team2, 30);
  188.                             Trans scoring;
  189.                             endif;
  190.  
  191.                             if ((Team2_Score_Holder) < 40) then
  192.                             addpoints(Team2, 40);
  193.                             Trans scoring;
  194.                             endif;
  195.  
  196.                             if ((Team2_Score_Holder) <> 50) then
  197.                             addpoints(Team2, 50);
  198.                             Trans scoring;
  199.                             endif;
  200.  
  201.                         else
  202.                             Team2_In = false;
  203.                             endif;
  204.                     endif;
  205.                 endif;
  206.  
  207.  
  208.  
  209.  
  210. endstate;
  211.  
  212.  
  213.  
  214. endfsm.
  215.  
  216.